<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var xhr = new XMLHttpRequest(); // 0

    xhr.open("get", "http://43.138.81.225/demo/php/searchAllGrade.php", true);  // 1

    xhr.send();  // 1

    xhr.onreadystatechange = function () {
        // 2  3  4
        console.log("readyState:", xhr.readyState);
        if (xhr.readyState == 4 && xhr.status == 200) {
            var result = xhr.responseText;
            result = JSON.parse(result);
            console.log(result);
        }
    }


</script>

</html>